<template>
  <div ref="chart" style="height: 400px">
    此处应该雷达图
  </div>
</template>

<script>
// import * as echarts from 'echarts'
import * as echarts from 'echarts/core'
import {
  RadarChart
} from 'echarts/charts'
import {
  CanvasRenderer
} from 'echarts/renderers'

echarts.use(
  [RadarChart, CanvasRenderer]
)

export default {
  mounted() {
    // 初始化
    const myChart = echarts.init(this.$refs.chart)
    // 绘制图表
    myChart.setOption({
      color: ['#f00', '#00f'],
      textStyle: {
        fontSize: 20
      },
      radar: {
        indicator: [
          { name: '销售', max: 6500 },
          { name: '管理', max: 16000 },
          { name: '信息技术', max: 30000 },
          { name: '客服', max: 38000 },
          { name: '研发', max: 52000 },
          { name: '市场', max: 25000 }
        ]
      },
      series: [{
        type: 'radar',
        data: [
          {
            value: [6500, 3000, 20000, 35000, 50000, 18000],
            name: '预算分配（Allocated Budget）'
          },
          {
            value: [5000, 16000, 28000, 26000, 42000, 21000],
            name: '实际开销（Actual Spending）'
          }
        ]
      }]
    })
  }
}
</script>

<style>

</style>
